'use strict';

angular.module('xianwan')
    .controller('MainController', function($scope, $state, LocalStorage, NW, $timeout, $rootScope) {
        let win = require('nw.gui').Window.get();
        $scope.currentPanel = null;// 用于控制模板

        win.showDevTools();// 显示控制台
        NW.init();// 初始化nw.js
        
        $rootScope.$on('showPanel',function(event,data){
            if ($scope.currentPanel != null) {
                return ;
            }
            $scope.currentPanel = data;
            console.log(data);
        })
        $rootScope.$on('closePanel',function(event,data){
            $scope.currentPanel = null
        })
    });